<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>生物支付</title>
  <link rel="stylesheet" href="{{ url_for('static', filename='css/styles.css') }}">
</head>
<body>
  <div class="container">
    <header class="header">
      <button class="back-btn" onclick="window.history.back()">←</button>
      <h2>生物支付</h2>
    </header>
    
    <div class="section">
      <div class="transport-card">
        <div>生物识别支付</div>
        <div class="card-balance">¥<span id="balance">12345.67</span></div>
      </div>
      
      <div class="bio-options">
        <div class="bio-option" onclick="selectBioMethod('face')">
          <img src="{{ url_for('static', filename='img/mrsb.png') }}" alt="面容识别">
          <p>面容识别</p>
        </div>
        <div class="bio-option" onclick="selectBioMethod('fingerprint')">
          <img src="{{ url_for('static', filename='img/zwsb.png') }}" alt="指纹识别">
          <p>指纹识别</p>
        </div>
      </div>
      
      <button onclick="startBioPay()" style="width: 100%; margin-top: 20px;">开始支付</button>
    </div>
  </div>
  
  <script>
    let selectedMethod = '';
    
    function selectBioMethod(method) {
      selectedMethod = method;
      document.querySelectorAll('.bio-option').forEach(el => {
        el.style.border = '1px solid var(--border-color)';
      });
      event.currentTarget.style.border = '2px solid var(--primary-color)';
    }
    
    function startBioPay() {
      if (!selectedMethod) {
        alert('请选择生物识别方式');
        return;
      }
      
      alert(`正在使用${selectedMethod === 'face' ? '面容识别' : '指纹识别'}进行支付`);
      // 模拟支付过程
      setTimeout(() => {
        alert('支付成功！');
        window.history.back();
      }, 2000);
    }
    
    // 页面加载时更新余额显示
    window.onload = function() {
      document.getElementById('balance').textContent = '12345.67';
    };
  </script>
  
  <style>
    .bio-options {
      display: flex;
      justify-content: space-around;
      margin: 20px 0;
    }
    
    .bio-option {
      text-align: center;
      padding: 15px;
      border-radius: var(--radius-sm);
      cursor: pointer;
      border: 1px solid var(--border-color);
    }
    
    .bio-option img {
      width: 60px;
      height: 60px;
      margin-bottom: 10px;
    }
  </style>
</body>
</html>